package com.ruiboyun.liveapp.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;

import com.ruiboyun.liveapp.R;
import com.ruiboyun.liveapp.base.BaseActivity;
import com.ruiboyun.liveapp.base.Url;
import com.ruiboyun.liveapp.util.tool.EditorShare;
import com.ruiboyun.liveapp.util.tool.ToasUtil;

import butterknife.Bind;
import butterknife.OnClick;

public class LoginActivity extends BaseActivity {

    @Bind(R.id.et_port)
    EditText etPort;
    @Bind(R.id.save)
    Button save;



    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    protected void afterCreate(@Nullable Bundle savedInstanceState) {

    }

    @OnClick(R.id.save)
    public void onViewClicked() {
        String trim = etPort.getText().toString().trim();
        if (TextUtils.isEmpty(trim)){
            ToasUtil.showCenterToast("端口号不能为空");
        }else {
            EditorShare.putString(Url.PORT,trim);
            launcher(MainActivity.class);
            finish();

        }
    }
}
